<template>
  <div class="shop">
    <Hea />
    <div class="tit">
      <input type="radio" />
      <span>苏打直供</span>
    </div>
    <div class="carlist">
      <input type="radio" />
      <img src="sx5.jpg" alt="" />
      <div>
        <div class="top">
          <p>【云南】沃柑9斤中果/大果</p>
          <span>9斤大果(28-35个)</span>
        </div>
        <div class="bottom">
          <span class="price">￥79.9</span>
          <del>￥85.9</del>
          <span class="num">x1</span>
        </div>
      </div>
    </div>
    <div class="carlist">
      <input type="radio" />
      <img :src="this.newshop[0].ingbn" alt="" />
      <div>
        <div class="top">
          <p>{{ this.newshop[0].title }}</p>
          <span>{{ this.newshop[0].miaoshu }}</span>
        </div>
        <div class="bottom">
          <span class="price">￥{{ this.newshop[0].price }}</span>
          <del>￥85.9</del>
          <span class="num">x1</span>
        </div>
      </div>
    </div>
    <div class="sum">
      <input type="radio" />
      <p>全选</p>
      <button>结算</button>
    </div>
  </div>
</template>

<script>
import Hea from "../components/shopcar/header.vue";

export default {
  components: {
    Hea,
  },
  data() {
    return {
      newshop: "",
    };
  },
  mounted() {
    console.log("我是传过来的id", this.$route.params.id);
    this.newshop = this.$store.state.homem.newsxs.sxpic.filter((v) => {
      if (v.id == this.$route.params.id) {
        return v;
      }
    });
    console.log("这是筛选后的数据", this.newshop);
    this.$store.commit("upsxxxx", this.newnumss);
    //  this.$store.dispatch("shopgoods",{ url: "/goodlift/data" })
  },
};
</script>

<style scoped>
.shop {
  background-color: #fff;
}
.tit {
  margin-top: 0.44rem;
  height: 0.44rem;
  /* background-color: pink; */
  display: flex;
  align-items: center;
}
input {
  width: 0.15rem;
  height: 0.15rem;
  margin: 0 0.15rem;
}
.carlist {
  width: 100%;
  display: flex;
  align-items: center;
  height: 1.23rem;
  border-top: 1px solid #ededed;
}
.carlist img {
  width: 0.95rem;
  height: 0.95rem;
}
.top span {
  font-size: 0.13rem;
  color: #797d82;
}
.bottom {
  display: flex;
  /* justify-content: space-around; */
  margin-top: 0.15rem;
  height: 0.2rem;
  line-height: 0.2rem;
}
.bottom .price {
  color: #c03131;
  font-size: 0.15rem;
}
.bottom .num {
  color: #bdc0c5;
  font-size: 0.13rem;
  margin-left: 1rem;
}
.bottom del {
  color: #bdc0c5;
  font-size: 0.12rem;
  margin-left: 0.05rem;
}
.sum {
  width: 100%;
  height: 0.5rem;
  position: fixed;
  bottom: 0.62rem;
  display: flex;
  align-items: center;
  border-top: 1px solid #ededed;
  background-color: #fff;
}
.sum p {
  color: #797d82;
  font-size: 0.15rem;
}
.sum button {
  width: 1.05rem;
  height: 100%;
  background-color: #c03131;
  color: #fff;
  border: 0;
  outline: none;
  margin-left: 1.9rem;
}
</style>